﻿using Sumc.Models.Responses;
using System;
using Windows.UI.Xaml.Data;

namespace Sumc.Client.ModernUI.Converters
{
    public class TransportTypeToImageConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            try
            {
                var transportType = (TransportType)value;
                switch (transportType)
                {
                    case TransportType.Bus:
                        return "ms-appx:///Assets/Icons/Bus.png";
                    case TransportType.Trolley:
                        return "ms-appx:///Assets/Icons/Trolley.png";
                    case TransportType.Tram:
                        return "ms-appx:///Assets/Icons/Tram.png";
                    default:
                        return string.Empty;
                }
            }
            catch
            {
                return value;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            return value;
        }
    }
}
